<?php
class Amin_model extends CI_Model{
    
    function __construct(){
        parent::__construct();
    }
    /**
     * @desc:   + Login the System
     *          + Session Init
     */
     
     function login_admin($username,$password)
     {
        $this->db->where('user_name',$username);
        $this->db->where('user_pass',$password);
        $this->db->get('user');
        
        $_SESSION['admin_login']=false;
        
        if($a->num_rows()>0)
        {
            $row=$a->row_array();
            $_SESSION['admin_id']                =  $row['user_id'];
            $_SESSION['admin_login']             =  TRUE;
            $_SESSION['username']       =$row['user_user'];
            $_SESSION['show']       = 0;
            $_SESSION['error_loginadmin']       =$row['user_id'];
            $_SESSION['admin_id']       =$row['user_id'];
        }
        
     }
}